<?php

class SET_NBC extends adminControl 
{
	private function check()
	{
		if (!$this->config['nbc'] || empty($this->config['nbcurl'])) {
			Showmsg('您尚未开启整合协同办公或者没有填写协同办公的地址，无法进行此项操作');
		}
	}
	
	protected function indexAction()
	{
		$this->check();
		$this->display('set_nbc');
	}
	
	protected function getInitAction()
	{
		require_once(R_P . 'require/class_nbc.php');
		$nbc = new NBC();
		list($addNum, $updateNum) = $nbc->init();
		adminmsg("用户数据同步成功，共新增 $addNum 个用户，更新了 $updateNum 个用户的资料。");		
	}
}

new SET_NBC();
?>